I am sure this is a simple question, but i have searched and did not find anything. I have a couple nodemcu controllers on my home assitant. Is there an easy way to find out what the WIFI signal strength is for them?
Thanks
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s
In ESPhome it’s as easy as stated in the previous answer. In case you’re not using ESPhome, you may take a look at their source code.
This is the esphome section
Ups, my bad
Woops, my bad. I neglected to mention that my nodemcu is flashed with ESPHome. So it sounds easy. Thanks to all.
So I have applied my changes, validated and uploaded them. I restarted HASS, but I don’t see the new sensor. DO I need to power cycle the nodemcu after uploading changes? Can this be done remotely? Sorry for the simple questions, but this is my first update to a nodemcu.
Thank you.
When you uploaded the new code it will restart the nodemcu and you should be able to see the new sensor showing up in the log. For the log to show up you must have the line logger:
in your configuration. It’s been a while since I installed esphome, so my memories are fuzzy/outdated, but your nodemcu will show up in the esphome integration, where you should be able to find your sensor. Make sure you have
# Enable Home Assistant API
api:
in your code, otherwise your sensor won’t show up in homeassistant magically.
Take a look at this video it goes through the basic steps on how to set up everything:
Okay, thank you. It would appear that I did everything correct because it is showing up in the boot log. I was actually looking in Developer Tools/states, assuming that it would show up with the other 2 sensors(temp and humidity) I have on this nodemcu(see log below). What am I missing, shouldn’t it show up there? A year later and I am still trying to figure out the steps.
Thanks for your help
[08:58:33][C][dht:017]: DHT:
[08:58:33][C][dht:018]: Pin: GPIO12 (Mode: INPUT)
[08:58:33][C][dht:022]: Model: DHT11
[08:58:33][C][dht:027]: Update Interval: 30.0s
[08:58:33][C][dht:029]: Temperature ‘NodeMCU2 TEemperature’
[08:58:33][C][dht:029]: Unit of Measurement: ‘°C’
[08:58:33][C][dht:029]: Accuracy Decimals: 1
[08:58:33][C][dht:029]: Icon: ‘mdi:thermometer’
[08:58:33][C][dht:030]: Humidity ‘NodeMCU2 Humidity’
[08:58:33][C][dht:030]: Unit of Measurement: ‘%’
[08:58:33][C][dht:030]: Accuracy Decimals: 0
[08:58:33][C][dht:030]: Icon: ‘mdi:water-percent’
[08:58:33][C][captive_portal:169]: Captive Portal:
[08:58:33][C][ota:029]: Over-The-Air Updates:
[08:58:33][C][ota:030]: Address: 192.168.1.150:8266
[08:58:33][C][ota:032]: Using Password.
[08:58:33][C][api:095]: API Server:
[08:58:33][C][api:096]: Address: 192.168.1.150:6053
[08:58:33][C][wifi_signal.sensor:009]: WiFi Signal ‘WiFi Signal’
[08:58:33][C][wifi_signal.sensor:009]: Unit of Measurement: ‘dB’
[08:58:33][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[08:58:33][C][wifi_signal.sensor:009]: Icon: ‘mdi:wifi’
[08:58:34][D][api.connection:604]: Client ‘Home Assistant 2021.5.1 (192.168.1.141)’ connected successfully!
[08:58:48][D][dht:048]: Got Temperature=21.8°C Humidity=21.0%
[08:58:48][D][sensor:092]: ‘NodeMCU2 TEemperature’: Sending state 21.80000 °C with 1 decimals of accuracy
[08:58:48][D][sensor:092]: ‘NodeMCU2 Humidity’: Sending state 21.00000 % with 0 decimals of accuracy
[08:59:17][D][sensor:092]: ‘WiFi Signal’: Sending state -72.00000 dB with 0 decimals of accuracy
[08:59:18][D][dht:048]: Got Temperature=21.8°C Humidity=21.0%
[08:59:18][D][sensor:092]: ‘NodeMCU2 TEemperature’: Sending state 21.80000 °C with 1 decimals of accuracy
[08:59:18][D][sensor:092]: ‘NodeMCU2 Humidity’: Sending state 21.00000 % with 0 decimals of accurac’
In HA, if you go to Settings->Devices->[The ESPHome device]->Entities and then show the disabled entities, is it present there?
Sorry, but I cannot find settings on my main HA menu. However I went to Dongiruation/Devices and selected my device and the new wifi signal sensor shows up as an entity.
So your only issue now is that it doesn’t show under Developer Tools/states? Note that the new sensor will be sensor.wifi_signal
.
Problem solved. It actually was there, just at the very bottom becuase it was added a lttle different than my other 2 sensors so the name was not sensor.nodemcu2.wifi IT was sensor.wifi. So it was there, I just did not see it because I was expecting it to be right with the other 2. for what it is worth, below is the code inside for my nodemcu and you can see what I am talking about. I will just have to change the format a but so they are grouped together. Works great though. Thank you all!
sensor:
- platform: dht
pin: D6
temperature:
name: "NodeMCU2 Temperature"
humidity:
name: "NodeMCU2 Humidity"
update_interval: 30s
model: DHT11
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s