This is an automated archive made by the Lemmit Bot.
The original was posted on /r/homeassistant by /u/1n6w3coza on 2023-07-06 08:56:27+00:00.
Inspired by this post:
(5) Replacing Victron Remote Monitoring (VRM) with Home Assistant : homeassistant (reddit.com)
I created this card:
Mirrors the LEDs on Multiplus-II. I wanted to share the code.
Using Home Assistant with MQTT integration to Victron Cerbo GX, and “custom:button-card”. My MQTT integration is direct (Home Assistant <> Cerbo GX on same network), so it works even if internet connection is down.
Of course, the sensors have to exist - here is an example of the “mains on” LED sensor:
- name: "Solar - MultiPlus LED Mains"
unique_id: "solar_multiplus_led_mains"
state_topic: "N/<your-victron-id>/vebus/276/Leds/Mains"
value_template: "{{ value_json.value }}"
Provided as-is, I’m not a developer and the result came through trial and error. Probably lots of room for improvement, but it works for me.
Here is the code:
type: custom:button-card
entity: sensor.solar_ac_input_power
name: Multiplus-II
show_icon: false
styles:
card:
- background-color: '#000000'
- border-radius: 10%
grid:
- grid-template-areas: >-
"n n" "ac_in ac_in" "header_left header_right" "row1_left row1_right"
"row2_left row2_right" "row3_left row3_right" "row4_left row4_right"
- grid-template-columns: 1fr 1fr
- grid-template-rows: min-content min-content min-content
name:
- font-weight: bold
- font-size: 30px
- color: white
- justify-self: left
- padding-left: 20px
- padding-bottom: 20px
custom_fields:
ac_in:
- font-weight: bold
- font-size: 20px
- align-self: start
- justify-self: left
- padding-left: 20px
- padding-bottom: 30px
header_left:
- font-weight: bold
- font-size: 20px
- align-self: start
- justify-self: left
header_right:
- font-weight: bold
- font-size: 20px
- align-self: start
- justify-self: left
row1_left:
- padding: 2px
- align-self: start
- justify-self: start
row1_right:
- padding: 2px
- align-self: start
- justify-self: start
row2_left:
- padding: 2px
- align-self: start
- justify-self: start
row2_right:
- padding: 2px
- align-self: start
- justify-self: start
row3_left:
- padding: 2px
- align-self: start
- justify-self: start
row3_right:
- padding: 2px
- align-self: start
- justify-self: start
row4_left:
- padding: 2px
- align-self: start
- justify-self: start
row4_right:
- padding: 2px
- align-self: start
- justify-self: start
custom_fields:
ac_in: |
[[[
return `AC Input:
${entity.state} W`
]]]
header_left: |
[[[
return `charger`
]]]
header_right: |
[[[
return `inverter`
]]]
row1_left: |
[[[
if (states["sensor.solar_multiplus_led_mains"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: lime;">
</ha-icon> mains on`;
else if (states["sensor.solar_multiplus_led_mains"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: lime; animation: blink 1s infinite;">
</ha-icon> mains on`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> mains on`;
]]]
row1_right: |
[[[
if (states["sensor.solar_multiplus_led_inverter"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: lime;">
</ha-icon> inverter on`;
else if (states["sensor.solar_multiplus_led_inverter"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: lime; animation: blink 1s infinite;">
</ha-icon> inverter on`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> inverter on`;
]]]
row2_left: |
[[[
if (states["sensor.solar_multiplus_led_bulk"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold;">
</ha-icon> bulk`;
else if (states["sensor.solar_multiplus_led_bulk"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold; animation: blink 1s infinite;">
</ha-icon> bulk`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> bulk`;
]]]
row2_right: |
[[[
if (states["sensor.solar_multiplus_led_overload"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red;">
</ha-icon> overload`;
else if (states["sensor.solar_multiplus_led_overload"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red; animation: blink 1s infinite;">
</ha-icon> overload`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> overload`;
]]]
row3_left: |
[[[
if (states["sensor.solar_multiplus_led_absorption"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold;">
</ha-icon> absorption`;
else if (states["sensor.solar_multiplus_led_absorption"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold; animation: blink 1s infinite;">
</ha-icon> absorption`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> absorption`;
]]]
row3_right: |
[[[
if (states["sensor.solar_multiplus_led_low_battery"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red;">
</ha-icon> low battery`;
else if (states["sensor.solar_multiplus_led_low_battery"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red; animation: blink 1s infinite;">
</ha-icon> low battery`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> low battery`;
]]]
row4_left: |
[[[
if (states["sensor.solar_multiplus_led_float"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold;">
</ha-icon> float`;
else if (states["sensor.solar_multiplus_led_float"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: gold; animation: blink 1s infinite;">
</ha-icon> float`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> float`;
]]]
row4_right: |
[[[
if (states["sensor.solar_multiplus_led_temperature"].state == 1)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red;">
</ha-icon> temperature`;
else if (states["sensor.solar_multiplus_led_temperature"].state == 2)
return `<ha-icon
icon="mdi:circle"
style="width: 16px; height: 16px; color: red; animation: blink 1s infinite;">
</ha-icon> temperature`;
else
return `<ha-icon
icon="mdi:circle-outline"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon> temperature`;
]]]
You must log in or register to comment.