So i have a python script that i run on a remote raspberry pi with a pir hc s501 motion sensor.
i have a binary sensor setup with platform mqtt, but not sure what to use as a state_topic,
First what does this have to do with Zwave config?
Why do you think that subscribing to a MQTT topic will allow a rest request to populate an MQTT service?
Your remote PI should publish to a MQTT broker on the state_topic defined above and thatās assuming you have a broker setup in the first place thoā
well i have an mqtt broker running for several cameras with motion using motioneyeos, and a curl command with the json object seems to work fine with it. but i understand what youre saying i should probably use mosquitto publish from the remote pi to the home assistant server. ill give that a tryā¦thanks! i am new to this(insert excuse here) just started back in jan. and im not that familiar with mqtt.
no problem tho you should move this out of zwave config as itās not related at all, probably better off in normal config
MQTT seems to confuse a lot of peeps (me to in the early days if Iām honest), but itās really simple. Think of the mqtt broker as a message board that anyone can send a message to and can pick up a message from provided they know the message route, where the message route is the topic. So one side publishes a message to a topic and the other side that wants to receive it subscribes to that topic, thatās it really, simple
yup, i think my confusion was based off how i was applying notification commands to the mqtt broker via curl and the restful api. maybe setting up an http binary sensor for the zwave would work as well.
lol true, i also have a zwave device monoprice with motion temperature battery and humidity, just no hub yet. and i have no idea how to wire the damn thing to my raspberry pi(so far)ā¦i purchased a ha1000, but that was a waste, they had been discontinued (staples connect) and the device was already registered. Then i tried the uboot exploit to drop into a shell so i could control it since i kept getting a 503.x certificate error when i would try to access the http user interface. but i think its bricked lol.
yeah i know i need a z stick but i was trying to make it a little cheaper, then just 3d print a case for the raspberry pi and the zwave device.i mean i should be able to wire it to the gpioās some how straight off the zwave board, theres several holes in it for that purpose i believe, just need to find the schematics.
no im talking about the zwave, i already have the pir sensor working just now trying to finish up the script using paho-mqtt for python, im gonna have that script run on boot, then when it picks up motion it will send a connect to the broker and publish to the topic, then go back to standby after 5 seconds, once i figure out how to place the password in the connect parameters with paho-mqtt i should be good to go.
all i had to do was add quotes to the json dictionary and it works fine LOLOLOLOL.
compare data above to my data below, just had to put in quotes. configuration.yaml:
Well itās funny in a strange way as this still has nothing to do with MQTT or zwave, what you are doing is calling in to the HA api to set the state of a variable, that variable could just as well be a standard binary sensor or just a sensor, it has nothing to do with mqtt. However congrats on solving it
youre right!!, i got confused with my zwave sensor and my pir sensor. but once i learn how to wire the zwave device to the raspberry pi⦠ill let you know, so if someone wants to bypass purchasing a zstick or hub and run straight from the gpio, youll just need a raspberry pi and any zwave device(and a 3d printer for a case), i mean a raspberry pi zero w is only 15 bux and a raspberry pi is like 35 bux, where as z stick runs around 40 - 50, and if you just have 1 zwave sensor, youre good to go.
Have a look at the link I posted above, the zwave stick can be had for Ā£5, thatās a UK version, for the US you would need a different one but the cost wouldnāt be much more than $7 i would think