nav208
(Jan Navrátil)
January 11, 2022, 3:45pm
1
Hello, i need to control the volume of the chromecast via mqtt.
Can I use 2 channels in 1 item?
Dimmer Google_Asistent_Volume3 "Hlasitost" <soundvolume> (Office, gAssistenten) { channel=" chromecast:audio:7e38d5f23908478fd348fc72e7aab72c:volume, mqtt:topic:mqtt_thing:Google_Asistent_Volume3", autoupdate="on" }
Now via MQTT is dimmer item changed, bud chromecast volume not.
When you change the dimmer via BasicUI the chromecast volume is changed.
Thanks for help.
rossko57
(Rossko57)
January 11, 2022, 4:10pm
2
Yes. But -
Both channels can update Item state.
Both channels will get Item commands.
Neither channel cares what the other channel does i.e. if an update comes in via one channel, it will not get sent to to other.
What relationship are you trying to create here, what needs things doing to it (command) and what is reporting status (update)?
nav208
(Jan Navrátil)
January 11, 2022, 4:20pm
3
rossko57:
Yes. But -
Both channels can update Item state.
Both channels will get Item commands.
Neither channel cares what the other channel does i.e. if an update comes in via one channel, it will not get sent to to other.
What relationship are you trying to create here, what needs things doing to it (command) and what is reporting status (update)?
I want to control chromecast volume via MQTT topic
When receiv mqtt command mqtt:topic:mqtt_thing:Google_Asistent_Volume3
value, than set chromecast volume.
When 1 item is enough, I don’t want to use 2 items and a rule.
rossko57
(Rossko57)
January 11, 2022, 4:23pm
4
Use the MQTT channel option to post incoming messages as commands to the Item. Then the chromecast channel will gets its command.
nav208
(Jan Navrátil)
January 11, 2022, 4:38pm
5
yes can you please write an example code?
rossko57
(Rossko57)
January 11, 2022, 4:57pm
6
There is no code.
However you set up your MQTT channel, go back there and change the postCommand setting to true, described in the docs