I’m running HA in a container on an Rpi4. It works with the MQTT integration though mosquitto is running on the host. I have moshad running, also not in container, and I can send commands in the terminal, such as echo ‘pl a2 on’ | nc localhost 1099 . I put this in the config yaml:
I do not see any entries for mochad (not moshad, sorry) in the entities list, or for ceiling_lights or ceiling_fan. That’s why I think I’m missing something. But when I click add integration and search for mochad, I find nothing. What do I need to install or add besides the configuration.yaml entries to get mochad entities. Thanks.
Logbook shows nothing because there’s no entity related to mochad or to the switches in the dropdown on the logbook page. Is it really that all that HA needs are the entries in config.yaml? On the HA docs page referring to mochad there is a link to “mochad component,” but that link only refers back to the same page. There needn’t be any files in custom_components for mochad, as there are for say, govee? Thanks again for help.
~/homeassistant/.config $ grep mochad home-assistant.log
2022-06-08 17:40:34 ERROR (MainThread) [homeassistant.components.switch] Error while setting up mochad platform for switch
File "/usr/src/homeassistant/homeassistant/components/mochad/switch.py", line 45, in setup_platform
add_entities([MochadSwitch(hass, mochad_controller.ctrl, dev) for dev in devs])
File "/usr/src/homeassistant/homeassistant/components/mochad/switch.py", line 45, in <listcomp>
add_entities([MochadSwitch(hass, mochad_controller.ctrl, dev) for dev in devs])
File "/usr/src/homeassistant/homeassistant/components/mochad/switch.py", line 62, in __init__
File "/usr/src/homeassistant/homeassistant/components/mochad/switch.py", line 106, in _get_device_status
File "/usr/local/lib/python3.9/site-packages/pymochad/device.py", line 55, in get_status
File "/usr/local/lib/python3.9/site-packages/pymochad/controller.py", line 83, in read_data
it’s an Rpi4 and yes, systemctl status mochad shows it active. It is running on the host, not in a container.
I found one error in the config yaml and changed comm_type from pl to rf. Now I have the entities ceiling_lights and ceiling_fan. When I use this in an automation and run the action, the trace says it has executed:
Yes, As I said in the first post I am trying to get mochad to work when HA is running in a docker container. I can’t use the disk image as there is no way that I know of to use the matrix voice with the diskimage. (If anyone knows a way, I’d love to hear it.)
So, HA in docker. HA uses pymochad, which is a library of python scripts that call the TCP daemon nc. From the terminal, nc is running and sends signals to the physical devices. In HA, running an automation with the switch does nothing, even though trace says the action was run. So I went looking for pymochad within the docker container holding HA. There is a folder in there called custom_components that has folders for hacs, govee (both of which work) and for mochad. That folder, unlike the others, is empty. Could this be the problem? The other custom_components folders have .py and .json files. Should the mochad folder have these files, and if so, where can I get them?