Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the state #11

Closed
Marius-Perju opened this issue Mar 3, 2020 · 10 comments
Closed

How to get the state #11

Marius-Perju opened this issue Mar 3, 2020 · 10 comments
Labels
question Further information is requested

Comments

@Marius-Perju
Copy link

Hi, thank you for your solution, it works great with the http, I'm new to coding and I'm still trying to understand how to work with mqtt (I have openhab 2.5.2 now so the documentation is not so much and not so clear)

Would it be possible to explain how to get the actual state of the relay on an .items file? I can see the state by accessing http://ip/state but I would like the item to be updated when the state changes.

Thank you

@ljalves
Copy link
Owner

ljalves commented Mar 10, 2020

I also use openhab but I use MQTT (it's much easier) - also I'm not sure how to do it with http.

@ljalves ljalves added the question Further information is requested label Mar 10, 2020
@Marius-Perju
Copy link
Author

Marius-Perju commented Mar 12, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 15, 2020

Check if the module<->mosquitto communication is working first.
You can do it by using the linux command line, in your case (if you have "1" configured as "ON value" and "0" as "OFF value"):
mosquitto_pub -t CT/releu -m "1" --------> should turn it on
mosquitto_pub -t CT/releu -m "0" --------> should turn it off
(assuming you are running this on the same machine as the mosquitto server, else you need to specify the host with -h)

Finally, work on openhab until you see the correct messages arriving to the subscribed topic.
And to do that, on a different console type this command:
mosquitto_sub -t CT/releu

@ljalves
Copy link
Owner

ljalves commented Mar 22, 2020

Any news?

@Marius-Perju
Copy link
Author

Marius-Perju commented Mar 23, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 24, 2020

I can't see the image...

@Marius-Perju
Copy link
Author

Marius-Perju commented Mar 24, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 25, 2020

Copy/paste the text here instead of a image...

@Marius-Perju
Copy link
Author

Marius-Perju commented Mar 25, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 25, 2020

If you don't know the passwords of your system of course that you can´t make it work...
Check file: /etc/openhab2/services/mqtt.cfg
It should have the password for mosquitto mqtt server.

Well, since this is not a bug/issue I'm closing it.
Regards.

@ljalves ljalves closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants