toreamun / victorsmartkill-homeassistant

Home Assistant integration for Victor Smart-Kill WI-FI electronic mouse and rat traps from VictorPest.com.
MIT License
18 stars 4 forks source link

Entities not populated #14

Closed AseKarlsson closed 2 years ago

AseKarlsson commented 2 years ago

Hi Tore, Just bought my Smart-Kill M1 Mouse trap. Nice integration from you, but some of the fileds does not seem to populate and stays as Unknown (see attached picture). Have I missed something in the setup? (Extra question: What will the status be for "Kills Present" when I cought a mouse instead of "Clear" so I can write automation?)

Thanks, AseKarlsson

img

toreamun commented 2 years ago

Nice to hear that you like the integration. I am sorry to hear that some sensors is unavailable. That probably means they are not returned from the API. I don't know why. The same has previously been reported for the temperature. I can be interesting to see if some of them becomes available after the first catch. Maybe it has to do with the trap model. What model and firmware is displayed in the device info panel? I can look into if I can enable a trace switch to see the actual data returned from the API.

AseKarlsson commented 2 years ago

Hi Tore,

Thanks for your fast reply!

Latest HA 2021.12.7

It is the M1 Mouse Trap. Trap

Any good tip to fake a catch?

Thanks, AseKarlsson

AseKarlsson commented 2 years ago

Hi Tore,

FYI the other fields got populated after the first kill, but the temperature is still Unknown. Any ideas how to solve the temperature, would be good info because the trap is located in the attic? Entity for “Connection Lost” would be nice, this happens when I run out of batteries.

Thanks, AseKarlsson

toreamun commented 2 years ago

Any good tip to fake a catch? I have not testet, but you can try to get som kind of light short short circuit between the metal plates. Different kind of insects has given me false catch.

toreamun commented 2 years ago

FYI the other fields got populated after the first kill, but the temperature is still Unknown. Any ideas how to solve the temperature, would be good info because the trap is located in the attic?

I am about to add more response logging to be able to look at what the API returns for your trap.

Entity for “Connection Lost” would be nice, this happens when I run out of batteries.

I will look into it. Do you know what the APP says when this occurs?

toreamun commented 2 years ago

Sorry for very late answers.

Nice integration from you, but some of the fileds does not seem to populate and stays as Unknown (see attached picture).

Sensors will show unknown when no information is returned. A new trap or reset trap will have no kills/escapes, and show Unknown in the start. It is maybe better to report 0, but if some types of traps never reports a count, Unknown will be better than 0. I am thinking of returning 0 for when number of kills or escapes is Unknown. But I think I should report Unknown for "number of retreats" as I have never seen anything else reported. What do you think?

It seems like some traps dont report temperature. My oldest trap with firmware 1.3.2 reports temperature, but my new trap with firmware 2.0.17 does not. I am going to disable the temperature sensor by default at initial setup if the value is unknown. The sensor can then be enabled in the user interface if it suddenly should start reporting temperature (not very likely).

(Extra question: What will the status be for "Kills Present" when I cought a mouse instead of "Clear" so I can write automation?)

It is a binary sensor with device class BinarySensorDeviceClass.OCCUPANCY. Displayed state will be Detected/Clear. I believe On/Off also can be used as alias of Detected/Clear.

Example automation using Sonos say script to alert:

alias: Mus i fellen
description: ''
trigger:
  - type: occupied
    platform: device
    device_id: 82f41a41194611eb9713d9cbf08a2d4d
    entity_id: binary_sensor.elektrokill_loft_capture
    domain: binary_sensor
condition: []
action:
  - repeat:
      while:
        - type: is_occupied
          condition: device
          device_id: 82f41a41194611eb9713d9cbf08a2d4d
          entity_id: binary_sensor.elektrokill_loft_capture
          domain: binary_sensor
      sequence:
        - service: script.sonos_say
          data:
            sonos_entity:
              - media_player.sonosone
              - media_player.sonos_play_3
            volume: 0.5
            message: Mus fellen.
        - delay: '00:01:00'
mode: single
AseKarlsson commented 2 years ago

Sorry for very late answers.

Nice integration from you, but some of the fileds does not seem to populate and stays as Unknown (see attached picture).

Sensors will show unknown when no information is returned. A new trap or reset trap will have no kills/escapes, and show Unknown in the start. It is maybe better to report 0, but if some types of traps never reports a count, Unknown will be better than 0. I am thinking of returning 0 for when number of kills or escapes is Unknown. But I think I should report Unknown for "number of retreats" as I have never seen anything else reported. What do you think?

I think unknown is fine to use.

It seems like some traps dont report temperature. My oldest trap with firmware 1.3.2 reports temperature, but my new trap with firmware 2.0.17 does not. I am going to disable the temperature sensor by default at initial setup if the value is unknown. The sensor can then be enabled in the user interface if it suddenly should start reporting temperature (not very likely).

Sad they removed that sensor.

(Extra question: What will the status be for "Kills Present" when I cought a mouse instead of "Clear" so I can write automation?)

Its fine like it is.

It is a binary sensor with device class BinarySensorDeviceClass.OCCUPANCY. Displayed state will be Detected/Clear. I believe On/Off also can be used as alias of Detected/Clear.

Example automation using Sonos say script to alert:

alias: Mus i fellen
description: ''
trigger:
  - type: occupied
    platform: device
    device_id: 82f41a41194611eb9713d9cbf08a2d4d
    entity_id: binary_sensor.elektrokill_loft_capture
    domain: binary_sensor
condition: []
action:
  - repeat:
      while:
        - type: is_occupied
          condition: device
          device_id: 82f41a41194611eb9713d9cbf08a2d4d
          entity_id: binary_sensor.elektrokill_loft_capture
          domain: binary_sensor
      sequence:
        - service: script.sonos_say
          data:
            sonos_entity:
              - media_player.sonosone
              - media_player.sonos_play_3
            volume: 0.5
            message: Mus fellen.
        - delay: '00:01:00'
mode: single
toreamun commented 2 years ago

https://github.com/toreamun/victorsmartkill-homeassistant/releases/tag/2022.2.1

toreamun commented 2 years ago

Entity for “Connection Lost” would be nice, this happens when I run out of batteries.

@AseKarlsson I have created a new issue for this. See https://github.com/toreamun/victorsmartkill-homeassistant/issues/24 Please comment the issue if you have more information about the update schedule of your traps.