New Shelly Pro 4PM - wifi & LAN & MQTT - First of Shelly Pro Series

And my automation on Home Assistant startup:

# Shellies Announce
- id: '010'
  alias: Shellies Announce
  trigger:
    - platform: homeassistant
      event: start
    - platform: time_pattern
      hours: "/12"  # Modifying this if you are using Shelly Motion can drain your device's battery quickly.
  action:
    service: mqtt.publish
    data:
      topic: shellies/command
      payload: announce
  mode: single

# Shellies Discovery
- id: '011'
  alias: Shellies Discovery
  max: 999
  trigger:
    platform: mqtt
    topic: shellies/announce
  action:
    service: python_script.shellies_discovery
    data:
      id: '{{ trigger.payload_json.id }}'
      mac: '{{ trigger.payload_json.mac }}'
      fw_ver: '{{ trigger.payload_json.fw_ver }}'
      model: '{{ trigger.payload_json.model }}'
      mode: '{{ trigger.payload_json.mode | default }}'
      host: '{{ trigger.payload_json.ip }}'
  mode: queued

- id: '014'
  alias: Shellies Announce Gen2
  trigger:
    - platform: homeassistant
      event: start
  variables:
    device_info_payload:  "{{ {'id': 1, 'src':'shellies_discovery', 'method':'Shelly.GetConfig'} | to_json }}"
  action:
    - service: mqtt.publish
      data:
        topic: "shellypro4pm-kabinet/rpc"  # shellypro4pm-aabbccddeeff is a device ID
        payload: "{{ device_info_payload }}"

- id: '015'
  alias: "Shellies Discovery Gen2"
  mode: queued
  max: 999
  trigger:
  - platform: mqtt
    topic: shellies_discovery/rpc
  action:
  - service: python_script.shellies_discovery_gen2
    data:
      id: "{{ trigger.payload_json.src }}"
      device_config: "{{ trigger.payload_json.result }}"

- id: '016'
  alias: "Shellies Status Gen2"
  trigger:
  - platform: time_pattern
    minutes: "/15"
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.publish
    data:
      topic: shellypro4pm-kabinet/rpc
      payload: "{{ {'id': 1, 'src':'shellypro4pm-kabinet/status', 'method':'Shelly.GetStatus'} | to_json }}"  # shellypro4pm-aabbccddeeff is a device ID

Have you tried looking at mqtt messages with some client like mosquitto-sub?

I tried to look with MQTT-Explorer… but if I’m honest don’t know what I’m doing :smiley:

I can paste what I get…

Great thread all - prompted me to buy one for research.

Has anyone any experience of feeding the sensor inputs (S1-4 / N) on the bottom of the Pro PMs with ultra-low voltage (5-12v)? Thinking along the lines of separating the sensors to run as ULV wall switches in a new build with the 240v relays being having relatively separate logic to run mains power.

Yours,

S.

Just one remark for the 4PM: all 4 lines must be on the same phase L. So it is not possible to connect multiple phases L1, L2, L3 to it.

Hi to every one,
I know this is old topic, but this one is talking about Selly 4PM. In last few months I installed three of them while replacing wiring or one flat. All three were (and still are) connected via WiFi.
But now LAN is also finished and I want to connect them via LAN. I have no problem with configuration, I gave each two static IP-s, one for WiFi and one for LAN. Now in HA i can switch between both ways of communication by changing IP address.

My question is:
Is it possible to somehow use BOTH (WiFi with one IP and LAN for another) for one device?
I mean, for redundancy purpose.
Is even possible in HA that messages from two IP addresses would be treated as messages from single device? And that duplicated messages would be ignored?

Looking forwars for your answers, best regards,
Martin