ShellyForHass custom component

Anyone got this working with the flood? Doesn’t seem to show the flood or temp sensors.

Does anyone has example to create an action?

I have a movement sensor, with the movement sensor triggered -> I want to click the switch on to turn onn the light…

As far as I understand you can use a normal automation for this.

Do you have any issues doing it this way? Can you please post your sample code?

I am searching for an example! :slight_smile:

Here is the exact thing you want if I understood correctly. If Motion detected (trigger), turn light on (action).

Hi does this need Shelly cloud to work ?
I have been using this now for a few months as well as there app, but have found when the cloud goes off line so do the devices from HA. Only for a few minutes and when cloud and Shelly app is working again so they reconnect with HA

No it does not.

So my question is twice I have found all my devices off line as well as the Shelly app unable to connect to the cloud. Once the cloud was working again all devices came back online I did not need to do anything except wait. All where offline for about 4 minutes.
As soon as The devices showed unavailable in HA I open the Shelly app which errors trying to connect to the cloud. ?

Sounds like you have network pronblems.

Network all good as HA and all other devices work fine, internet works fine you just could not connect to Shelly Cloud. But will keep and eye on it and do more tests next time

HI
I got Home assistant. Installed HACS and then Shellyfor Hass, but in UI Lovelace it discovers only one roller shutter instead of three and discover surprisingly 4 switches, that I don’t own.
Is it my mistake? Can I do something for discover all the three rollers shutters?
Thanks

Dear all,

Is there any successful integration of Shelly Flood without MQTT?
Could someone share her/his experience.

I cannot get temperature and flood status. In fact I do not see the shelly.
Even having “shelly:” in the configuration.yaml.

Regards,
xwox

Hi,

Today i recieved the Temperature addon and tried to add it to Home Assistant. But the temperature doesn’t show.

shelly:
  discovery: true
  upgrade_switch: true
  show_id_in_name: false
  sensors:
    - power
    - rssi
    - device_temp
    - switch
    - over_temp
devices:  
  - id: "xxxxxx"
    name: Buffervat
    entity_id: bijkeuken_buffervat

Did i made a mistake in the config?

I created a card that show different shellies wi-fi signal as bar charts. You get all the info when you hover or when you click the bar. I only have 2 shellies at the moment but i imagine it could work with many more.

type: custom:auto-entities
card:
  type: custom:mini-graph-card
  name: Shellies Wi-Fi Signal
  show:
    graph: bar
    state: true
    legend: false
    labels: true
    labels_secondary: false
  upper_bound: -30
  lower_bound: -90
  align_state: center
  hour24: true
  hours_to_show: 1
  points_per_hour: 1
  bar_spacing: 2
  color_thresholds:    ### https://eyesaas.com/wi-fi-signal-strength/
   - value: -30
     color: "#7ECA27"
   - value: -50
     color: "#CCE10F"
   - value: -60
     color: "#F1EE1C"
   - value: -67
     color: "#FCDD0F"
   - value: -70
     color: "#F8A62B"
   - value: -80
     color: "#F58511"
   - value: -90
     color: "#EF4522"
filter:
  include:
    - entity_id: '*rssi*'
1 Like

I have Shelly RGBW2 and LED stripe which has RGBW + white.
Now I have problem how to control white LEDs directly from lovelace GUI…

Current look:
image

Current configuration:

entities:
  - light.shelly_rgbw2_dnevna
  - entity: light.shelly_rgbw2_dnevna
    full_row: true
    step: 1
    type: 'custom:slider-entity-row'
  - colors:
      - brightness: 220
        effect: 'Off'
        icon_color: '#c0c0c0'
        rgb_color:
          - 255
          - 255
          - 255
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#990000'
        rgb_color:
          - 255
          - 0
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#009900'
        rgb_color:
          - 0
          - 255
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#999900'
        rgb_color:
          - 255
          - 255
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#009999'
        rgb_color:
          - 0
          - 255
          - 255
        transition: 1
        white_value: 0
      - brightness: 220
        effect: Gradual change
        icon_color: center/120% url('/local/images/rainbow.png')
        transition: 1
        white_value: 0
      - brightness: 3
        effect: 'Off'
        icon_color: center/95% url('/local/images/night_mode.png')
        transition: 1
        white_value: 0
    entity: light.shelly_rgbw2_dnevna
    justify: between
    type: 'custom:rgb-light-card'
show_header_toggle: false
title: LED trak
type: entities

So, how to add additional slider which will have ON/OFF function + brightness of only white LEDs…

How to use second (marked with red color) slider? Currently controlling only rgbw slider (marked with green color).
image

So the goal is something like that:
image

Thank you for support…

1 Like

Here is my code for a Shelly Bulb Duo, it has a slider for both Brightness and White value.

-   platform: mqtt
    schema: template
    name: "Living Room Sofa Lamp"
    command_topic: "shellies/ShellyBulbDuo-xxxxxx/light/0/set"
    state_topic: "shellies/ShellyBulbDuo-xxxxxx/light/0/status"
    # Convert from 0-255 to 0-100
    command_on_template: >
      {"turn": "on"
      {%- if brightness is defined -%}
      , "brightness": {{ (brightness * 0.392) | int }}
      {%- endif -%}
      {%- if white_value is defined -%}
      , "white": {{ (white_value * 0.392) | int }}
      {%- endif -%}
      }
    command_off_template: '{"turn": "off"}'
    state_template: >
            {% if value_json.ison %}
              on
            {% else %}
              off
            {% endif %}
    # Convert from 0-100 to 0-255
    brightness_template: '{{ (value_json.brightness * 2.55) | int }}'
    white_value_template: '{{ (value_json.white * 2.55) | int }}'

I understand that you have white value under “pop-up” menu, also me:

But the goal is to have white value also under lovelace card… how to achieve that?

PS. I’m using API, not MQTT for shelly…

I tried with you code:

  - platform: mqtt
    schema: template
    name: "Dnevna RGBW2"
    command_topic: "shellies/shellyrgbw2-XXXXXX/light/0/set"
    state_topic: "shellies/shellyrgbw2-XXXXXX/light/0/status"
    # Convert from 0-255 to 0-100
    command_on_template: >
      {"turn": "on"
      {%- if brightness is defined -%}
      , "brightness": {{ (brightness * 0.392) | int }}
      {%- endif -%}
      {%- if white_value is defined -%}
      , "white": {{ (white_value * 0.392) | int }}
      {%- endif -%}
      }
    command_off_template: '{"turn": "off"}'
    state_template: >
            {% if value_json.ison %}
              on
            {% else %}
              off
            {% endif %}
    # Convert from 0-100 to 0-255
    brightness_template: '{{ (value_json.brightness * 2.55) | int }}'
    command_off_template: '{"turn": "off"}'
    state_template: >
            {% if value_json.ison %}
              on
            {% else %}
              off
            {% endif %}
    # Convert from 0-100 to 0-255
    brightness_template: '{{ (value_json.brightness * 2.55) | int }}'

but I get error:
image

So I’m stuck here… I enabled MQTT on RGBW2 controller…

Your error says sensor.mqtt this should be a light not a sensor, maybe that is the issue.

Light:

  • platform: mqtt
    schema: template

Your code may be different for RGBW than mine, looks like you need to set mode from color to white. https://shelly-api-docs.shelly.cloud/#shelly-rgbw2-mqtt

I am not sure on the lovelace card, there are probably some custom entities you can add on GitHub, I found this but not sure if that helps. https://github.com/thomasloven/lovelace-slider-entity-row

I succeded, it was really simple…

image

First line is for white, and second line is brightness…

Code:

entities:
  - light.shelly_rgbw2_dnevna
  - attribute: white_value
    entity: light.shelly_rgbw2_dnevna
    full_row: true
    step: 1
    type: 'custom:slider-entity-row'
  - entity: light.shelly_rgbw2_dnevna
    full_row: true
    step: 1
    type: 'custom:slider-entity-row'
  - colors:
      - brightness: 220
        effect: 'Off'
        icon_color: '#c0c0c0'
        rgb_color:
          - 255
          - 255
          - 255
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#990000'
        rgb_color:
          - 255
          - 0
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#009900'
        rgb_color:
          - 0
          - 255
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#999900'
        rgb_color:
          - 255
          - 255
          - 0
        transition: 1
        white_value: 0
      - brightness: 220
        effect: 'Off'
        icon_color: '#009999'
        rgb_color:
          - 0
          - 255
          - 255
        transition: 1
        white_value: 0
      - brightness: 220
        effect: Gradual change
        icon_color: center/120% url('/local/images/rainbow.png')
        transition: 1
        white_value: 0
      - brightness: 3
        effect: 'Off'
        icon_color: center/95% url('/local/images/night_mode.png')
        transition: 1
        white_value: 0
    entity: light.shelly_rgbw2_dnevna
    justify: between
    type: 'custom:rgb-light-card'
show_header_toggle: false
title: LED trak
type: entities

To do this you do not need any MQTT, just use:
custom:rgb-light-card
custom:slider-entity-row
ShellyForHass (Shelly integration)

And everything is done automaticly, no need of MQTT coding…

The only goal is how to change design, so that custom icon is presented at front of sidebar…
Icons and maybe text like this:
image

The it’s perfect…

1 Like