I am using a spark.io Photon to control a couple of pumps (pool and bore).
I want to use HA to schedule when these run, possbily use the input from the solar panels to run them a bit smarter. I also want to be able to run these manually.
I can call the function via a POST, with a string argument of the form “PP1300”,
PP - Identifier (Pool Pump)
1 - On or Off (1 is on)
300 - time in seconds (300 seconds / 5mins)
This is easily accomplished for static times, however i would like to be able to manually adjust the run time by manipulating the time in seconds.
Is it possible to build the string in HA?
How else could i do it? (ie start it with a long timeout, then have HA execute the time out by triggering the off condition)
that gives me an alternative comms protocol to the device, but i guess my real question was how i could make a variable that changes depending on an input into HA.
Ie have a dial or something so i can set 5, 10, 15, 20 minutes then alter the command accordingly. I dont think the MQTT would help.
Well it actually does help. It shows you you can work it to have it post to your own mosquitto server.
Point it to the one you are using for HASS and subscribe to the topics created for your PHOTON and your good to go.
[color=#0040BF]4.In the “mqtttest.ino” Line 29 :
client.connect(“sparkclient”);
change it to :
client.connect(“HASSMQTT-URL”, “HASSMQTTCLIENTuserid”, “HAMQTTCLIENTpassword”);[/color]
AH, it is the input select that i am looking for. I am already using the restful api to talk to the photo, via command_switch and a curl post, hence the confusion around what MQTT has to do with it.
but the input_select should be the way to go.
Now, let me see if i understand it’s use (for a pool pump example):
create a list of typical time values
build my POST arguments to use the variable associated with my input selection.
I am trying to find out where i can find all the variables that are available to use in my HASS implementation, any suggestions on that?