Configuring Shelly EM Energy Meter

Mine arrived today. Holey shit that app is bad.

I cant even get my Shelly EM to connect to a local wifi network.

I connected to the EM’s local network.
Under user settings in the app I filled in the batch wifi update settings (2.4GHz network SSID and PWD) and selected both power meters that appear. Hit update but nothing appears in my DHCP server.

EDIT: I deleted the app and just used the web settings.

EDIT 2: Also if anyone is looking for an RSSI sensor, this works:

- platform: rest
  name: Shelly EM Wifi
  resource: http://10.1.1.24/status ### Edit to use the IP of your Shelly EM
  username: !secret shelly_usr ### Only required if you have set a password
  password: !secret shelly_pwd ###  "    "              "            "
  authentication: basic        ###  "    "              "            "
  value_template: '{{ value_json.wifi_sta.rssi }}'
  scan_interval: 180  ### Feel free to make faster, 30 or 60 sec would be fine
  unit_of_measurement: dB

Edit 3:

Another trap for players, who the flock uses Watt-minutes? Ugh. Fix:

- platform: mqtt
  name: "Tariff 31 Energy"
  state_topic: "shellies/shellyem-B9E940/emeter/0/energy"
  value_template: "{{ value|float / 60000 }}" # Fix for Watt-minutes
  qos: 1
  unit_of_measurement: "kWh"
  icon: mdi:chart-bar

- platform: mqtt
  name: "Tariff 41 Energy"
  state_topic: "shellies/shellyem-B9E940/emeter/1/energy"
  value_template: "{{ value|float / 60000 }}" # Fix for Watt-minutes
  qos: 1
  unit_of_measurement: "kWh"
  icon: mdi:chart-bar

EDIT 4:

But ignore those sensors because they wont work with the Utility meter if you want a daily energy used sensor (they reset to 0 if no power is used for a minute). You need to use a rest sensor to interrogate the yearly totals like this:

- platform: rest
  name: Tariff 31 Total Energy
  resource: http://10.1.1.24/status
  username: !secret shelly_usr
  password: !secret shelly_pwd
  authentication: basic
  value_template: '{{ value_json.emeters.0.total | float /1000 }}'
  scan_interval: 300 # no point updating faster than this. The Shelly only updates this every 5 minutes
  unit_of_measurement: kWh

- platform: rest
  name: Tariff 41 Total Energy
  resource: http://10.1.1.24/status
  username: !secret shelly_usr
  password: !secret shelly_pwd
  authentication: basic
  value_template: '{{ value_json.emeters.1.total | float /1000 }}'
  scan_interval: 300
  unit_of_measurement: kWh

Used in the Utility meter:

utility_meter:
  daily_light_and_power:
    source: sensor.tariff_31_total_energy
    cycle: daily
    tariffs:
      - peak
  daily_heating:
    source: sensor.tariff_41_total_energy
    cycle: daily
    tariffs:
      - offpeak

You can omit the tariff configuration. I only needed it as you cant use the reset service without them and testing required a bit of resetting.

All of this shenanigans could have been avoided if Shelly provided a daily energy used total. Like every other freaking smart power meter on the market.