Hey there! I’m attempting to build a virtual dimmer switch that i can expose to HomeAssistant to control my Microwave Hood Fan Speed through automations. I.E, if the oven turns on, always turn on the fan etc.
I’m making a rule to tie my virtual switch to my hood fan, but the rule keeps failing to save citing that my target for the command is invalid. My sample json is below:
Despite what you may still see in the API Reference, arguments needs an array of JSON objects. So rather than [ 0 ] I would try [ { "integer": 0 } ] and see if that is what made it barf.
Oh hang on, the "right": 0 probably needs fixing first otherwise you’ll get the same error. That needs to be { "integer": 0 }.
Oh and I’ve just seen another issue. Both equals and then should be properties of the if action object. So the object hierarchy should look like.
if
equals
left
right
then
command
I think you’ve got the then at the same level as the if.
And am getting this new error: Error adding rule “Microwave Fan Speed”. 422 The request is malformed. then: Unrecognized field “then” (class v20190122.internal.st.behaviors.Action), not marked as ignorable
Which doesn’t really make sense. But then i moved the then inside the if block as you mentioned, like this:
and got this: Error adding rule “Microwave Fan Speed”. 422 The request is malformed. component: Unrecognized field “component” (class v20190122.internal.st.behaviors.CommandAction), not marked as ignorable