question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Preserve additional device parameters

See original GitHub issue

Hi,

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:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mdoppcommented, Feb 20, 2018

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

1reaction
mdoppcommented, Feb 20, 2018

for git repo url it would be

“repository”: “github:mdopp/simple-sonoff-server”

Sorry, I really haven’t done that before, and want to make it right

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found