Skip to content

VALLHORN Motion Sensor also shows up as Light Sensor "devicetype" #104

@nestorix1343

Description

@nestorix1343

When activating my new (and first) VALLHORN in my python code using this library, I noticed in the callback function handling the Dirigera events, that the VALLHORN also gives an event as deviceType "lightSensor".

The event data looks like

{'id': '2e69259a-615b-4252-b3f8-53ecaeccb94a_3', 'type': 'unknown', 'deviceType': 'lightSensor', 'createdAt': '2024-12-02T20:31:01.000Z', 'isReachable': True, 'lastSeen': '2024-12-02T21:40:52.000Z', 'attributes': {'illuminance': 47}, 'remoteLinks': []}

The get_all_devices call gives another id for the VALLHORN Motion Sensor. It is almost the same except the _1 and _3 on the end.

 MotionSensor(id='2e69259a-615b-4252-b3f8-53ecaeccb94a_1', relation_id='2e69259a-615b-4252-b3f8-53ecaeccb94a', type='sensor', device_type='motionSensor', created_at=datetime.datetime(2024, 12, 2, 20, 31, 1, tzinfo=TzInfo(UTC)), is_reachable=True, last_seen=datetime.datetime(2024, 12, 2, 21, 23, 54, tzinfo=TzInfo(UTC)), attributes=MotionSensorAttributes(custom_name='Motion Sensor 1', model='VALLHORN Wireless Motion Sensor', manufacturer='IKEA of Sweden', firmware_version='1.0.64', hardware_version='1', serial_number='70C59CFFFED9562B', product_code='E2134', ota_status=None, ota_state=None, ota_progress=None, ota_policy=None, ota_schedule_start=None, ota_schedule_end=None, battery_percentage=67, is_on=False, light_level=None, is_detected=True), capabilities=Capabilities(can_send=[], can_receive=['customName']), room=Room(id='75efe5a0-0111-4e51-bc4a-ebe4ea94d0b9', name='Werkkamer', color='ikea_yellow_no_28', icon='rooms_office_chair'), device_set=[], remote_links=[], is_hidden=False, dirigera_client=<dirigera.hub.hub.Hub object at 0x1069c9d60>),

I have lights, outlets, environment sensors, remote controllers, water sensors, but the VALLHORN motion sensor is the only device which has a "relation_id" filled in. This appears to be the id without the _1 behind it.

The VALLHORN Motion Sensor is id 2e69259a-615b-4252-b3f8-53ecaeccb94a_1
The light sensing part is id 2e69259a-615b-4252-b3f8-53ecaeccb94a_3

I also get events for the Motion Sensor with id 2e69259a-615b-4252-b3f8-53ecaeccb94a_1 so that is working as it should:

{'id': '2e69259a-615b-4252-b3f8-53ecaeccb94a_1', 'type': 'sensor', 'deviceType': 'motionSensor', 'createdAt': '2024-12-02T20:31:01.000Z', 'isReachable': True, 'lastSeen': '2024-12-02T21:53:30.000Z', 'attributes': {'isDetected': True, 'sensorConfig': {'scheduleOn': False, 'onDuration': 180, 'schedule': {'onCondition': {'time': '22:00'}, 'offCondition': {'time': '06:00'}}}, 'circadianPresets': []}, 'remoteLinks': []}

Am I doing something wrong that the light sensor part of the VALLHORN is not part of the Motion Sensor device?

BTW: I cannot find anything about the light level / illuminance in the IKEA Home Smart app. So it might a future surprise from IKEA.

I was thinking what the best way of implementing this is?

  1. Creating a new device type "LightSensor" (because there might be other simple LightSensor devices in the future as well)
    or
  2. Creating some hack and get that illuminance of the lightSensor side of the VALLHORN in the motionSensor part?
    or
  3. Something else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions