Feature Request: Preserve additional device parameters
See original GitHub issueHi,
Looking at the log it seems sonoffs send additional interesting information that is not persisted. For example: MAC, RSSI, startup state of the switch. Additionally TH10/TH16 will send sensor’s data (if connected).
Here are device update requests:
// sonoff (update req #1) > server
{
"userAgent":"device",
"apikey":"111111111-1111-1111-1111-11111111111",
"deviceid":"10000xxxx",
"action":"update",
"params":{
"switch":"off",
"fwVersion":"2.0.4",
"rssi":-52,
"staMac":"5C:CF:7F:42:90:EF",
"startup":"off"
}
}
// sonoff (update req #1) > server
{
"userAgent":"device",
"apikey":"111111111-1111-1111-1111-11111111111",
"deviceid":"10000dba6b",
"action":"update",
"params":{
"currentTemperature":"21",
"currentHumidity":"28",
"sensorType":"AM2301"
}
}
Can you please preserve these fields in device’s object? Because these fields may vary from device to device, one possible solution will be to store them (as they appear) under a new property “params” in the WS:Update code. For example:
device.params = device.params || {};
Object.keys(data.params).forEach(function(p) {
device.params[p] = data.params[p];
});
Of course other suggestions are welcome 😃
Also it will be useful to include a property that keeps the date/time of last contact - like a timestamp. It will allow us to detect if the device haven’t reported for xyz minutes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
[Feature Request] save your playlists, subscriptions and ...
[Feature Request] save your playlists, subscriptions and settings in ... Request] A option to sync timestamp from NewPipe to other devices ...
Read more >Send feedback or suggest a feature - Microsoft Support
Send feedback from Settings. Tap your profile picture. Tap Settings Settings button . Tap Help & feedback Teams help icon . You have...
Read more >What to do if you get an alert that an AirTag, Find My network ...
If any AirTag, AirPods, or other Find My network accessory separated from its owner is seen moving with you over time, you'll be...
Read more >Network features reference - Chrome Developers
To save requests across page loads, check the Preserve log checkbox on ... In Settings > Throttling > Network Throttling Profiles, click Add...
Read more >Use Xfinity xFi Advanced Security
Learn more about using Xfinity xFi Advanced Security. ... Use the update feature usually found in your device's settings or check with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, the repo can be found here => https://github.com/saryn/node-red-contrib-sonoff-server I also created a pull request a week ago, to switch to a newer version, where I merged some of his changes into my version. So version 1.1.1 should contain all of his changes. 1.1.2 should also fix some problems that were still in his version. For npm => I do not know how to change that. Its belonging to @saryn
for git repo url it would be
Sorry, I really haven’t done that before, and want to make it right