Phc2Mqtt
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
I sent you a PM
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- HenningW
- Offline
- Fresh Boarder
- Beiträge: 4
- Dank erhalten: 0
Have a nice weekend
Henning
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
Will give a try on weekend
BR Paul
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
Great
Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
I get the module runnig and its prublishing the states to my mosquitto Broker.
No i use the app Mqttfx to test the commands over Mqtt.
i want to switch on module 7 out3
my <topic-prefix> is "Haus"
i tried to publishe
Haus/p2m/cmd/ccmd/omd.7.out3=on
i can see in the webconsole
2021-05-16,12:36:22,I,MQTC,<Haus/p2m/cmd/ccmd/omd.7.out3=on=
but it's not working the module 7 out3 stays off
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
Ok I should clarify this better in the manual.
The topic should be: Haus/p2m/cmd/ccmd
And the payload: omd.7.out3.on
Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
i start with a new openhab installation installing Mqtt binding and connecting it to my mosquitto broker.
but how i can map the payload correctly?
there are the following configuaration possible for a simple switch.
Channel
- Büro Licht
mqtt:topic:6cfb5163b8:buerodecke:Buerodecke
Configuration
Show advanced
- MQTT State Topic
- MQTT Command Topic
QoS
- At most once (best effort delivery "fire and forget")
- At least once (guaranteed that a message will be delivered at least once)
- Exactly once (guarantees that each message is received only once by the counterpart)
- Retained
- Is Command
- Custom On/Open Value
- Custom Off/Closed Value
Transform Values
These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.
- Incoming Value Transformations
- Outgoing Value Transformation
- Outgoing Value Format
____________________________________________________________________________________________________________________
I use the following configuration for:
MQTT State Topic "Haus/p2m/sta/omd.7"
MQTT Command Topic "Haus/p2m/cmd/ccmd/"
Custom On/Open Value "1"
Custom Off/Closed Value "0"
but what hast to be in:
Incoming Value Transformations
Outgoing Value Transformation
Outgoing Value Format
if i use:
Custom On/Open Value "omd.7.out3.on"
Custom Off/Closed Value "omd.7.out3.off"
i can switch on of the light but no state is given means if i manually activate the light via hardware switch the state is not updated!
Log says
2021-05-16 12:22:06.374 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"out3":1}' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.{"out3":1}
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
Second: about the format of the MQTT notifications, you can select different formats in Configuration -> PHC Logging
- xPhcLogd compatible -> will send 1 msg per event or channel status
- text format
- JSON format
I am not a user of OpenHab, maybe someone else can help for that
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
The Problem is the payload/structure is different for event and command
Structure;
for Command
Haus/p2m/cmd/ccmd/
for Event
Haus/p2m/sta/omd.7.out3
better will be
for Command
Haus/p2m/cmd/ccmd/omd.7.out3
for Event
Haus/p2m/sta/omd.7.out3
is this something you can change maybe as additional format for openhab?
Next how is the payload for jrm modules?
I tried
jrm.2.fb2.downon
the webconsole shows
2021-05-16,21:49:33,I,MQTC,<Haus/p2m/cmd/ccmd/=jrm.2.fb2.downon
but it did not work maybe becausethe =sign is in?
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- rick
- Offline
- Fresh Boarder
- Beiträge: 4
- Dank erhalten: 0
I just got my PHC2MQTT module working after some issues and will be trying next week to use it with the MQTT OpenHAB binding.
I can see the issues you have with the different structures for status updates and sending commands. Maybe it is solvable with the OpenHAB value transformations, but I'm not that familiar with OH3 yet.
You can find the payload for sending commands in the ccmd reference in the main menu of the PHC2MQTT web interface.
For the JRM it is like this:
jrm.<0-31>.out<0-3>.down.<prioLevel:0-5>.<prioLock:0-1>.<run:1-65535 1/10s>
In your example jrm.2.out2.down.1.0.600 or something. JRM module 2, output number 2 of that module, priority 1, no priority lock and let it run for 60 seconds.
The fb2 is for the feedback to let the user know that the command was received I think.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- rick
- Offline
- Fresh Boarder
- Beiträge: 4
- Dank erhalten: 0
jrm.2.out2.down.1.0.run:600
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
Where topic = <topic-prefix>/cmd/ccmd
And payload is the command like: omd.0.out0.toggle
In the Ccmd Reference you will see things like: jrm.<0-31>.out<0-3>.down.<prioLevel:0-5>.<prioLock:0-1>.<run:1-65535 1/10s>
This means you can enter: jrm.0.out0.down.0.0.200
Everything between <..> is possible input, if it shows a text like <prioLevel:0-5> then prioLevel is a textual description of the parameter and 0-5 is the input range.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Ricotchet
- Offline
- Senior Boarder
- Beiträge: 69
- Dank erhalten: 1
jrm.2.out1.down.0.0.200
jrm.2.out1.stop.0
jrm.2.out1.up.0.0.200
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
Can you try to select the xPhcLogd compatible Format in Configure PHC Logging to see if this is better for OpenHab
If needed we can implement another format that better suits OpenHab
About the jrm commands, checkout Main Menu -> CCmd Reference and then click on the link for 'jrm'
If you want to go up 20 seconds you send: jrm.0.out0.0.0.200
To stop send: jrm.0.out0.stop.0
The 'fb' commands are typical events that the jrm sends back to the stm to keep track of it's status.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Aktuelle Seite:
- Startseite
- Forum
- PHC-Forum
- PHC2Mqtt
- Phc2Mqtt