Integration : Home assistant - themactep/thingino-firmware GitHub Wiki

To configure camera in home assistant, add onvif integration. Then add a new camera and let it autodiscover. In my case autodiscovery failed but it prompted me for IP address of camera. Once entering auth details it added it correctly.

When manually setting up the camera with ONVIF, the port will be "80" and the default username and password is "thingino". The login credentials can be changed from the settings > RTSP/ONVIF Access page of the Thingino interface.

The URL to get snapshot from camera is

http://thingino:thingino@[ipOfYourCamera]/image.jpg

Add white led in home assistant

For now it requires polling to get status.


light:
  - platform: template
    lights:
      z55_light:
        unique_id: "z55_light"
        turn_on:
          - action: rest_command.z55_camera_light_on
        turn_off:
          - action: rest_command.z55_camera_light_off
        #value_template: "{{ is_state('binary_sensor.z55_light_status', 'on') }}"
        value_template: "{{ states('binary_sensor.z55_light_status') }}"
template:
  - unique_id: z55_light_status_template
    trigger:
      - trigger: time_pattern
        seconds: /30
    action:
      - action: rest_command.z55_camera_light_status
        response_variable: z55_response
    binary_sensor:
      - name: z55_light_status
        unique_id: z55_light_status
        state: >
          {{ z55_response['content']['message']['white'] == 1 }}

rest_command:
  z55_camera_light_on:
    url: "http://z55.home/x/json-imp.cgi?cmd=white&val=1"
    username: root
    password: MyRootPassword
    verify_ssl: false
    method: get

  z55_camera_light_off:
    url: "http://z55.home/x/json-imp.cgi?cmd=white&val=0"
    username: root
    password: MyRootPassword
    verify_ssl: false
    method: get

  z55_camera_light_status:
    url: "http://z55.home/x/json-imp.cgi?cmd=white&val=read"
    username: root
    password: MyRootPassword
    verify_ssl: false
    method: get
    headers:
      Accept: "*/*"

Add a Picture Glance Card with PTZ Controls

The ONVIF implementation in Home Assistant does not expose PTZ controls as entities. You will need to add custom code to add the controls. The following is the full YAML for a Picture Glance Card with PTZ control. Be sure to update with the proper camera entity name.

camera_view: live
fit_mode: cover
type: picture-glance
title: Cinnado T23
image: http://thingino:[email protected]/image.jpg
camera_image: camera.cinnado_profile_1
entities:
  - entity: camera.cinnado_profile_1
    name: Pan Left
    icon: mdi:arrow-left
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.cinnado_profile_1
        pan: LEFT
        speed: 1
        distance: 0.01
        move_mode: ContinuousMove
  - entity: camera.cinnado_profile_1
    name: Tilt Up
    icon: mdi:arrow-up
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.cinnado_profile_1
        tilt: UP
        speed: 1
        distance: 0.01
        move_mode: ContinuousMove
  - entity: camera.cinnado_profile_1
    name: Tilt Down
    icon: mdi:arrow-down
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.cinnado_profile_1
        tilt: DOWN
        speed: 1
        distance: 0.01
        move_mode: ContinuousMove
  - entity: camera.cinnado_profile_1
    name: Pan Right
    icon: mdi:arrow-right
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.cinnado_profile_1
        pan: RIGHT
        speed: 1
        distance: 0.01
        move_mode: ContinuousMove
  - entity: binary_sensor.cinnado_motion_alarm

Set Motion Guard

Since Thingino doesn't expose Motion Guard settings via the ONVIF interface, Home Assistant shows an error when using the built-in Enable/Disable Motion Detection actions. While enabling or disabling the Motion Guard service in Thingino is only possible through a websocket, changing the notification target is possible via a simple HTTP GET request.

The URL is http://[user]:[password]@[camera IP address]/x/json-motion.cgi?target=[target]&state=[true|false]

Where the target is one of: email | ftp | mqtt | telegram | webhook | ntfy

See also the source in json-motion.cgi