Skip to content

Simple Service Example

Matthew Scoville edited this page Sep 13, 2020 · 3 revisions

Simple Service example that checks a binary sensor and outputs pass/fail based on the state.

"""
Service script
"""
@service
def test():
    if binary_sensor.workday == 'on':
        log.info(f"State Trigger test: fail")
        pass
    else:
        log.info(f"State Trigger test: pass")
        pass