dCon0ne
(Don Con)
January 8, 2018, 6:19pm
1
I’m not a programmer, bye any means. So, what code would I need to add(and where) to Ben,s Multisensor’s sketch, so that it would report the WIFI’s signal strength?
I think, this would be nice addion to Ben,s Multisensor’s , to be able to monitor the WIFI’s signal strength, wherever I deploy one of these Nodes…
1 Like
Now I have not tested this but I believe you just add line 355 as I have done here. After that you should be able to see it pop up in the JSON that gets sent to MQTT.
https://hastebin.com/edenogizez.ino
dCon0ne
(Don Con)
January 12, 2018, 5:04am
3
Ok, so I looked at your sketch(@sunnythaper ), and added the following; (see the last line)
void sendState() {
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["state"] = (stateOn) ? on_cmd : off_cmd;
JsonObject& color = root.createNestedObject("color");
color["r"] = red;
color["g"] = green;
color["b"] = blue;
root["brightness"] = brightness;
root["humidity"] = (String)humValue;
root["motion"] = (String)motionStatus;
root["ldr"] = (String)LDR;
root["temperature"] = (String)tempValue;
root["heatIndex"] = (String)calculateHeatIndex(humValue, tempValue);
root["signal_strength"] = (String)WiFi.RSSI(); // ADDED THIS @ Line #355
And when I check the Serial Monitor, I see the following; (see the 'End of the line)
{"state":"OFF","color":{"r":255,"g":255,"b":255},"brightness":255,"humidity":"54.00","motion":"standby","ldr":"768","temperature":"68.00","heatIndex":"67.04","signal_strength":"-58"}
So, it is looking GOOD, so-far, so in the “config.yaml”, I addedthe following:
- platform: mqtt
state_topic: "climate/li-room"
name: "Signal Strength"
unit_of_measurement: "db"
value_template: '{{ value_json.signal_strength | round(1) }}'
And, this is where I lose it… Because, in hassio, I’m not see the Entity,(sensor.signal.strength) for the above code.
Can anyone see what I am doing wrong???
Since the value is being sent as a string, I think your
| round(1)
might be to blame. If that’s not it, I’d recheck your state_topic value.
dCon0ne
(Don Con)
January 12, 2018, 5:24pm
6
I found my mistake, I was looking in the ENTITY list for “livingroom_signal_strength”. But should have been looking for just “signal_strength”.
It"s working now, Thanks sunnythaper…
1 Like