hey i would need help trying to get a wifi fan in home assistant, am very new in programming and home assistant so way too little prerequisites,
have managed to get ip address
ex 192.168.0.01
and that it listens to port 4000.
also got hold of a schedule with control commands
looking for help with how to write the code itself to send a command
attaches command schedule with example codes
Try this version. I wrapped the entire command in single-quotes and, just for good measure, added the -n option to echo (to suppress the inclusion of a \n at the end of the hex string).
If you login to the machine hosting Home Assistant and, at the command prompt, execute that command (without the outer single-quotes, of course), does it work?
In this situation, it’s best to debug the shell commands first, (from a command shell) without involving Home Assistant. When you know the commands work perfectly, then add them to Home Assistant. If they fail to work at that point, then you know it has something to do with Home Assistant.
seems to work no error atleast, can the problem be in virtual box ?
running home assistant on intel nuc with unbuntu and virtual box
when i try the command i just paste in
echo -n -e “\0x6D\0x6F\0x62\0x69\0x6C\0x65\0x03\0x04\0x01\0x0D\0x0A” | nc 192.168.86.40 4000
in the terminal ?
sorry but very new to this =)
thank you so far for the help i will recive a new fan tomorrow it was transport damage on this one (maybe part off the problem why it dont respond from terminal)
Yes, paste that string, press the enter key, and it will be executed. If it runs without error then we can only assume it did its job and sent the hex string to the desired IP address and port.
If you want to confirm that the transmission is actually working, you can run nc on another computer (let’s call it the “listener”) and make it listen on port 4000. The command would be:
nc -l 4000
It will just sit there quietly until it receives something on port 4000 and will then display it.
Now modify your existing command so that it sends the hex string to the IP address of the “listener” computer. Execute the modified command and you should see some gibberish (the hex string) appear on the listener’s screen. This confirms you can successfully transmit the hex string from one computer to another (or to your fan). After the test is finished, press Ctrl-C on the listener computer to stop the nc command.
If the fan doesn’t respond to the transmitted hex string the way you expected, either it’s not actually connected to the network, or its not listening on port 4000, or the hex string is incorrect so the fan ignores it.