Set the state of input_boolean to off using appdaemon

Hey all,

I am trying to write a very basic script:

import hassapi as hass


class test(hass.Hass):

    def initialize(self):
        self.listen_state(self.search,"input_boolean.turnscript", new="on")
    
    def search(self, entity, attribute, old, new, kwargs):
        self.set_textvalue("input_text.text1", "hello world")
        self.turn_off("input_boolean.turnscript")

It all works, except it doesn’t turn the input_boolean back off.

How would I do this?

Thanks in advance!

The code looks just fine. Does the input_text.text1 entity exists in HA? Does it work of you comment out that line?

Anything in the appdaemon logs?

I have an app that is using this:

self.set_state("input_boolean.turnscript", state = "off")

and it’s working fine.