Cool, thanks. And right you are, I removed the bash.
Short term, my scripts right now are mainly for learning purposes, but this set of them are to control an electric kettle (Smarter iKettle V1). I had set it up using tasker and autovoice on my phone, but I’m trying to get everything integrated in home assistant (and just backed the MATRIX voice, so hoping I can make everything play nice before that starts shipping). I have the scripts shown in the scripts.yaml posted above (other scripts are unrelated, and just for etsting stuff). The other *.sh files referred to in the shell_commands.yaml (also see above) are:
ikettle100.sh (turn on kettle, set to 100°C):
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x80\n" | nc 192.168.0.20 2000
ikettle95.sh (turn on kettle, set to 95°C).
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x02\n" | nc 192.168.0.20 2000
ikettle80.sh (turn on kettle, set to 80°C).
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x4000\n" | nc 192.168.0.20 2000
ikettle65.sh (turn on kettle, set to 65°C).
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x200\n" | nc 192.168.0.20 2000
ikettleoff.sh (turn off kettle)
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x0\n" | nc 192.168.0.20 2000
These are to set the kettle to different temperatures (as described here), or turn it off. But at some point I also plan to include scripts to keep the kettle warm for either 5, or 10 minutes, which would look like this (this is for keeping warm for 5 minutes):
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x8005\n" | nc 192.168.0.20 2000
I think it has to be sent after turning it on at a certain temperature; it didn’t seem to work if I just added this to the end of one of the others (like e.g. this):
#!/bin/bash
echo -e "HELLOKETTLE\nset sys output 0x4\nset sys output 0x80\nset sys output 0x8005\n" | nc 192.168.0.20 2000
Which I think makes sense, when you look at the app layout (the “keep warm” is a separate button you can press after you press a certain temperature).
And perhaps I would want to include an alarm (there is a status message it will send if it detects that the kettle is dry), and have my lights blink or something, as a warning. That would be something about listening for the kettle putting out status messages, and I haven’t really gotten around to looking into this.
Is it a bad idea to have these as separate *.sh files? You think it would be more efficient having a single “kettle control” file/script? If so, I’d love to hear your suggestions.