Hue dimmer + hue bulb

Hi
Newbie here.

I have Pi zero W+haspbian, mosquitto. I don’t have HUE bridge.

I would like to use hue bulb + hue dimmer + Aqara PIR.

At the moment I’m able to switch on and off with dimmer and PIR.

Problems:

  1. I don’t know how to configure dimming.

  2. When Light is on because of PIR. The dimmer sensor is in stage “off”. Can I change the dimmer stage when I switch on lights with PIR?

  3. Why dimmer remote is a sensor? Is it more like a switch?

Thanks in advance.

I think I found solution:

automation:
- id: ‘1542038741351’
alias: HUE remote dim
trigger:
- entity_id: sensor.0x00178801020e7267
platform: state
to: down-press
condition: []
action:
- service: script.ciemniejzarowke
- data:
payload: ‘{“battery”:100,“linkquality”:84,“action”:“NULL”}’
topic: zigbee2mqtt/0x00178801020e7267
service: mqtt.publish

Script

List item

ciemniejzarowke:
  alias: Ciemniej zarowke
  sequence:
    service: light.turn_on
    data_template:
      entity_id: light.0x0017880102446500
      transition: '1'
      brightness: >
            {% set suggested = state_attr("light.0x0017880102446500","brightness")|int - 51 %}
            {% if suggested > 30 %}
            {{ suggested }}
            {% else %}
            30
            {% endif %}

hi Dyczek, is this solution working for you? This code is for down-press only and then you have a similar one to up-press?

Hi
At the moment I use the hue bridge. As far as I remember this code was latest. It was ok (but probably not very efficient) with version 0.84.
Raspberry W also wasn’t a good idea.

Code above is for “down-press” to make lights darker.
Yes you need similar for up-press to make light brighter.

#######SCRIPT FOR "up-press":
jasniejliving_room_1stol:
  alias: Living jasniej
  sequence:
    service: light.turn_on
    data_template:
      entity_id: light.living_room_1stol
      brightness: '{% set suggested = state_attr("light.living_room_1stol","brightness")|int
        + 51 %} {% if suggested < 255 %} {{ suggested }} {% else %} 255 {% endif %}        '

#########SCRIPT FOR "down-press"
ciemniejliving_room_1stol:
  alias: Living Ciemniej 
  sequence:
    service: light.turn_on
    data_template:
      entity_id: light.living_room_1stol
      brightness: '{% set suggested = state_attr("light.living_room_1stol","brightness")|int
        - 51 %} {% if suggested > 30 %} {{ suggested }} {% else %} 30 {% endif %}'

regards