Do we have to change the topics also in user_config.h. I am getting output for serial monitor like -
.
WiFi connected
client mqtt not connected, trying to connect
Attempting MQTT connection…
connected to MQTT broker
subscription OK to the subjects defined
not like - arduino “connected” & “subscription OK to home/MQTTto433/” and nothing coming up more on serial monitor
This is the output i am getting. Maybe problem is with RF transmitter and receiver but i was using same on RPi with command line in HA. I have double checked the connection with nodemcu. Using pin d1 and d2. Now LWT is also showing offline
@Partybug this config you have here, is this for a switch or binary sensor or ? I can’t seem to get this to trigger when the pir sends it’s payload so i went to use a trigger in the automation but i rather have this defines separately.
Had to re-read the forum. I posted several configs. All of them are for etekcity switches except for the doorbell. I do have a pir sensor in my office now and I use it to turn on one etekcity switch and a philips hue light in the ceiling. The pir sensor is a compatible one listed in this forum so it sends a 433mhz code to the gateway for MQTT.
Here’s my trigger section of my config for the pir. You will have to set up your automation scripts which are covered in another forum. Hope this helps.
The pir sensor sends multiple instances of the same code in rapid succession. So I turn this script above (script.officepres) off for 2 minutes before I want to see the next motion. The script.officemot will turn off the light automatically after 10 minutes passes. If there is motion every 2 minutes - the timer is reset. Occasionally the lights turn off if I’m reading a long forum post and forget to move. You can’t perfect everything.
that is great, good job @partybug, i am very interested turn on tekcity when i seat on my chair.
did you use any occupancy sensor ? chair or bed? i would like use that, but i dont find any configuration to use a esp and mqtt. i find one solution, but use mysensors,and i dont want do build other gateway.
@ReneTode i already saw that vídeo, but that uses mysensors, i would like only use one ESP8266 with mqtt under my bed. because i dont want to build other gateway to use mysensors.
i think if i use this code:
it Works, what do you think.
Sorry off topic. i will open a new post on PROJECTS
indeed. a mysensors on an ESP8266 can be a wifi gateway itselve and at the same time be a sensor.
so every ESP can be its own gateway, but every second ESP or arduino can also connect to a gateway.
it cant function as a mysensors without a radio. (allthough that a gateway with sensors actually could function without a radio, but then you need to alter the base library from mysensors)
the radio is 1 of the baseparts from mysensors.
but they are cheap, and unless you want to connect a lot of sensors, mostly the radio is not an annoying part.