Translating old mqtt to new mqtt binding need help

i trz to use the HASP hardware which is described here in this forum but it is programmed with the old mqtt binding and I tried to translate it but failed…Can some one help me with this translating??

here is the old mqtt item

Number HASP_Plate01_Page "HASP Plate 01 Page Select [%d]" (HASP) {mqtt=">[broker:hasp/plate01/command/page:command:*:default]"}

my translation was

Number HASP_Plate01_Page "HASP Plate 01 Page Select [%d]" (HASP) {channel="mqtt:topic:haspplate01:command_page"}

Thing mqtt:topic:haspplate01 (mqtt:broker:mosquitto) {
    Type number : command_page "command_page" [ stateTopic="hasp/plate01/command/page"]

but failed is this correct??

my mqtt broker is working for other topics already…

Look at commandTopic in the binding docs

Hello thanks,
helped me…

But I have one question about the the state topic.

is this correctly configured?

Switch HASP_Plate01_Light_Power "HASP Plate 01 Backlight Switch [%s]" (HASP) {channel="mqtt:topic:haspplate01:lightswitch" [profile="follow"]}
Switch HASP_Plate01_Light_Status "HASP Plate 01 Backlight Status [%s]" (HASP) {channel="mqtt:topic:haspplate01:lightswitch"
Thing mqtt:topic:haspplate01 (mqtt:broker:mosquitto) {

    Type switch : lightswitch "lightswitch"   [stateTopic="hasp/plate01/light/state", commandTopic="hasp/plate01/light/switch", expires="30s", on="ON", off="OFF"]



or how do I use the statetopic correctlz??

No idea; I don’t know what you are trying to achieve.
Your original single v1 Item had only an outgoing binding link.
stateTopic is for listening to incoming messages.

What’s the follow profile for?

What’s the expires= parameter in your Thing channel? No mention of that in binding docs; you can’t just make syntax up…

1 Like