Surepetcare configuration lock_state

Hi

I’m really sorry if I ask something really obvious. I did search the net. Nobody seems to have that issue…

On Sure Petcare - Home Assistant it is written, that for the service to set the lock state the flap_id as well as lock_state must be set to true.

I managed to “load” my surepetcare into homeassistant. I simply have no idea what the syntax in configuration.yaml is to enable the functionality of locking / unlocking the flap. I have testet many possible syntaxes. Every single one returned the message that I have a wrong config.

Can anyone point me to the correct syntax? Or am I even in the wrong file? example below

surepetcare:
  username: mail
  password: pw
  flaps_id: True
  lock_state: True

Thank you.

You are mixing the configuration and the calling of a service.

The setting of

  flaps_id: True  SHOULD BE flap_id
  lock_state: True

Should be in an automation or a script as they are services

You should see the service when you select Call service in Automation action. You will need to find the flap_id (it is an integer) and lock_state should be set as

  • unlocked - flap is unlocked, pets are allowed both in and out.
  • locked_in - flap is ‘in only’ - pets can come in but not go back out.
  • locked_out - flap is ‘out only’ - pets can go out, but not back in.
  • locked_all - flap is locked both ways

Hope this gets you moving forward

Thank you very much. For all the HA/surepetcare beginners:

  • Only login credentials have to go in configuration.yaml. everything else is going in scirpts, automation etc. E.g. timebased automation:
- id: 'xxxxxxxxxxxxxxxxxx'
  alias: Katzenklappe aussperren
  description: Katzen werden um 0030 ausgesperrt
  trigger:
  - platform: time
    at: 00:30
  condition:
  - condition: numeric_state
    entity_id: sensor.wettersensor_plus_temperature
    above: '0'
  action:
  - service: surepetcare.set_lock_state
    data:
      flap_id: 'xxxxx'
      lock_state: locked_out

Wher to find the flap_id? Good question - took me a while to figure out! Go to Sure Petcare and login with your surepetcare-app credentials. When you click on your flap/pet, ID’s can be found in the URL.

Thanks again for helping out!!

Many improvements are done in HomeAssistant 2021.10.

Yaml config is deprecated and replaced with config from UI.
You will also have locks to control and see the state of the locks.

Cool looking forward to it.