Input_boolean question

Hi there!
I have an external process that tracks my wife and I’s phone and determines when we’re in our out of the house. I have defined two input_boolean’s for us in Home Assistant and then set them to on or off by making calls to the HASS API. I can tell this is working because I can see them change in the logbook.
However, it displays really oddly in the Overview tab. There’s an input_boolean section with the two variables I’ve defined, but instead of showing the toggle as Off when someone is out of the home, it shows as On regardless of whether the status is on of off.
Hope this makes sense!! :slight_smile:
-Dan

input_boolean:
  dan:
    name: 'Dan'
  julia:
    name: 'Julia'

image

Do you mean by using an automation?

If so it would help if you posted that code.

I guess it’s a pseudo automation, it’s not in home assistant, it’s running on a heroku server. I modified it to make a call to the api like this:

        var data = {
            url: 'http://HASSURL:8123/api/states/input_boolean.dan',
            json: true,
            headers: { 'x-ha-access': 'PASSWORD'},
            body: { state: (danhome==1 ? 'On' : 'Off') }
        };
        request2.post(data, function(error, httpResponse, body){
            console.log(body);
        });

As I said, I can tell this works because I see the state flip in the logbook… thx for your help!

Try with ‘off’ and ‘on’, note the case.

If you definitely see the input boolean state in the dev tools states menu (lower left hand menu button looks like <>) ‘off’ and the front end is showing it as on then this should be reported as an issue.

The “off” and “on” vs “Off” and “On” fixed it… Thanks so much!!
-Dan

when working with case sensitive environments, I found it easiest to make everything lowercase to cut out the confusion anywhere.

2 Likes