Author: Stefan

  • Proxmox Host backup

    Backup the following folders/files:

    /var/lib/pve-cluster/config.db
    /etc/corosync/*
    /etc/network/interfaces
    /etc/hostname
    /etc/hosts

  • Victron MQTT configurations

    Add the following code to your mqtt.yaml file:

    sensor:
      # Grid meter power
      - state_topic: "venus-home/N/c0619xxxxxx/grid/30/Ac/Power"
        name: "Grid power"
        unique_id: "grid_meter_power"
        device_class: power
        value_template: '{{ value_json.value | round(0) }}'
        unit_of_measurement: "W"
        icon: mdi:TransmissionTower
    
      # Victron alarms
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/CellImbalance"
        name: "Alarm cell imbalance"
        unique_id: "alarm_battery_cell_imbalance"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
          
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/ChargeBlocked"
        name: "Alarm Charge blocked"
        unique_id: "alarm_battery_charge_blocked"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
          
    
          
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/DischargeBlocked"
        name: "Alarm Discharge blocked"
        unique_id: "alarm_battery_discharge_blocked"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/HighChargeCurrent"
        name: "Alarm high charge current"
        unique_id: "alarm_battery_high_charge_current"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/HighChargeTemperature"
        name: "Alarm high charge temperature"
        unique_id: "alarm_battery_high_charge_temperature"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/HighDischargeCurrent"
        name: "Alarm high discharge current"
        unique_id: "alarm_battery_high_discharge_current"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
          
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/HighTemperature"
        name: "Alarm high temperature"
        unique_id: "alarm_battery_high_temperature"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/HighVoltage"
        name: "Alarm high voltage"
        unique_id: "alarm_battery_high_voltage"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/InternalFailure"
        name: "Alarm internal failure"
        unique_id: "alarm_battery_internal_failure"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/LowChargeTemperature"
        name: "Alarm low charge temperature"
        unique_id: "alarm_battery_low_charge_temp"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/LowTemperature"
        name: "Alarm low temperature"
        unique_id: "alarm_battery_low_temp"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Alarms/LowVoltage"
        name: "Alarm low voltage"
        unique_id: "alarm_battery_low_voltage"
        value_template: >
          {% if value_json.value == 0 %}
            OK
          {% elif value_json.value == 1 %}
            Warning
          {% elif value_json.value == 2 %}
            Alarm
          {% endif %}
    
      # Victron Cerbo GX Serial number
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Serial"
        name: "Cerbo GX Serial number"
        unique_id: "victron_cerbo_serial"
        value_template: '{{ value_json.value }}'
    
      # Active SoC limit  
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Control/ActiveSocLimit"
        name: "Active SoC limit"
        unique_id: "active_soc_limit"
        device_class: battery
        unit_of_measurement: "%"
        value_template: '{{ value_json.value | round(0)}}'
        icon: mdi:battery-low
    
      # AC ActiveIN L1 Current
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/ActiveIn/L1/Current"
        name: "AC ActiveIn L1 Current"
        unique_id: "victron_activein_L1_current"
        device_class: current
        value_template: '{{ value_json.value |float(0)|round(2) }}'
        unit_of_measurement: "A"
        icon: mdi:power-socket-eu   
    
      # AC ActiveIN L1 Current
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/ActiveIn/L2/Current"
        name: "AC ActiveIn L2 Current"
        unique_id: "victron_activein_L2_current"
        device_class: current
        value_template: '{{ value_json.value |float(0)|round(2) }}'
        unit_of_measurement: "A"
        icon: mdi:power-socket-eu  
    
      # AC ActiveIN L1 Current
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/ActiveIn/L3/Current"
        name: "AC ActiveIn L3 Current"
        unique_id: "victron_activein_L3_current"
        device_class: current
        value_template: '{{ value_json.value |float(0)|round(2) }}'
        unit_of_measurement: "A"
        icon: mdi:power-socket-eu  
    
      # Grid Lost Status
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Alarms/GridLost"
        name: "Grid Lost Status"
        unique_id: "victron_grid_lost_status"
        value_template: > 
          {% if value_json.value == 0 %}
            Grid Connected
          {% elif value_json.value == 2 %}
            Grid Lost
          {% endif %}
    
      # Current Grid Setpoint
      - state_topic: "venus-home/N/c0619xxxxxx/settings/0/Settings/CGwacs/AcPowerSetPoint"
        name: "Current grid setpoint"
        unique_id: "current_grid_setpoint"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
    
        # Battery percentage
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Soc"
        name: "Battery Percent"
        unique_id: "battery_percent"
        device_class: battery
        value_template: '{{ value_json.value | round(1) }}'
        unit_of_measurement: "%"
      
        # Battery percentage
      - state_topic: "venus-home/N/c0619xxxxxx/battery/512/Soh"
        name: "Battery Health"
        unique_id: "battery_health"
        device_class: battery
        value_template: '{{ value_json.value | round(1) }}'
        unit_of_measurement: "%"
    
      # AC Loads
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/P"
        name: "AC Loads"
        unique_id: "ac_loads"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu
     
      # L1 Load
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L1/P"
        name: "L1 Load"
        unique_id: "L1_load"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu
     
      # L1 Output Voltage
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L1/V"
        name: "L1 Output Voltage"
        unique_id: "L1_Output_Voltage"
        device_class: voltage
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "V"
        icon: mdi:power-socket-eu
    
      # L1 Output frequency
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L1/F"
        name: "L1 output frequency"
        unique_id: "L1_output_frequency"
        device_class: frequency
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "Hz"
        icon: mdi:sine-wave    
    
      # L2 Load
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L2/P"
        name: "L2 Load"
        unique_id: "L2_load"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu    
    
      # L2 Output Voltage
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L2/V"
        name: "L2 Output Voltage"
        unique_id: "L2_Output_Voltage"
        device_class: voltage
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "V"
        icon: mdi:power-socket-eu
    
      # L2 Output frequency
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L2/F"
        name: "L2 output frequency"
        unique_id: "L2_output_frequency"
        device_class: frequency
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "Hz"
        icon: mdi:sine-wave    
    
      # L3 Load
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L3/P"
        name: "L3 Load"
        unique_id: "L3_load"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu    
    
      # L3 Output Voltage
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L3/V"
        name: "L3 Output Voltage"
        unique_id: "L3_Output_Voltage"
        device_class: voltage
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "V"
        icon: mdi:power-socket-eu
    
      # L3 Output frequency
      - state_topic: "venus-home/N/c0619xxxxxx/vebus/276/Ac/Out/L3/F"
        name: "L3 output frequency"
        unique_id: "L3_output_frequency"
        device_class: frequency
        value_template: '{{ value_json.value|round(1) }}'
        unit_of_measurement: "Hz"
        icon: mdi:sine-wave
    
      # L1 Grid
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/Grid/L1/Power"
        name: "L1 Grid"
        unique_id: "L1_grid"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu 
        
      # L2 Grid
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/Grid/L2/Power"
        name: "L2 Grid"
        unique_id: "L2_grid"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu 
    
      # L3 Grid
      - state_topic: "venus-home/N/c0619xxxxxx/system/0/Ac/Grid/L3/Power"
        name: "L3 Grid"
        unique_id: "L3_grid"
        device_class: power
        value_template: '{{ value_json.value }}'
        unit_of_measurement: "W"
        icon: mdi:power-socket-eu 
    
      # DC Loads
      - name: "DC Loads"
        device_class: power
        unique_id: "dc_loads"
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/System/Power"
        value_template: '{{ value_json.value|float(0)|round(0) }}'
        unit_of_measurement: "W"
        icon: mdi:power
        
      # Net Solar Production
      - name: "Current Solar Production"
        unique_id: "net_solar_production"
        device_class: power
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/Pv/Power"
        value_template: '{{ value_json.value|float(0)|round(0) }}'
        unit_of_measurement: "W"
        icon: mdi:solar-power
      
      # Battery Voltage
      - name: "Battery Voltage"
        unique_id: "battery_voltage"
        device_class: voltage
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/Battery/Voltage"
        value_template: '{{ value_json.value|float(0)|round(1) }}'
        unit_of_measurement: "V"
    
      # Battery Temp (If you have a temp sensor)
      - name: "Battery Temp"
        device_class: temperature
        unique_id: "battery_temperature"
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/Battery/Temperature"
        value_template: '{{ ((value_json.value * 9/5) + 32) | round(0) }}'
        unit_of_measurement: "°F"
    
      # Net load going in/out of your battery
      - name: "Battery Load"
        unique_id: "battery_load"
        device_class: power
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/Vebus/Power"
        value_template: '{{ value_json.value |float(0)|round(0) }}'
        unit_of_measurement: "W"
        
      # Net current going in/out of your battery
      - name: "Battery Current"
        unique_id: "battery_current"
        device_class: current
        state_topic: "venus-home/N/c0619xxxxxx/system/0/Dc/Vebus/Current"
        value_template: '{{ value_json.value |float(0)|round(0) }}'
        unit_of_measurement: "A"
    
      # Temperature Multiplus II - Phase 1
      - name: "Temperature MPII #1"
        unique_id: "temp_mpII_1"
        device_class: temperature
        state_topic: "venus-home/N/c0619xxxxxx/temperature/25/Temperature"
        value_template: '{{ value_json.value |float(0)|round(0) }}'
        unit_of_measurement: "°C"
    
      # Temperature Multiplus II - Phase 2
      - name: "Temperature MPII #2"
        unique_id: "temp_mpII_2"
        device_class: temperature
        state_topic: "venus-home/N/c0619xxxxxx/temperature/26/Temperature"
        value_template: '{{ value_json.value |float(0)|round(0) }}'
        unit_of_measurement: "°C"
    
      # Temperature Multiplus II - Phase 3
      - name: "Temperature MPII #3"
        unique_id: "temp_mpII_3"
        device_class: temperature
        state_topic: "venus-home/N/c0619xxxxxx/temperature/27/Temperature"
        value_template: '{{ value_json.value |float(0)|round(0) }}'
        unit_of_measurement: "°C"
    
      # Temperature Multiplus II - Phase 3
      - name: "Pylontech battery power"
        unique_id: "pylontech_batt_power"
        device_class: power
        state_topic: "venus-home/N/c0619xxxxxx/battery/512/Dc/0/Power"
        value_template: '{{ value_json.value |round(0) }}'
        unit_of_measurement: "W"
    
      # Current State of your Inverter
      - name: "Inverter State"
        unique_id: "inverter_state"
        state_topic: "venus-home/N/c0619xxxxxx/system/0/SystemState/State"
        value_template: >
          {% if value_json.value == 0 %}
            Off
          {% elif value_json.value == 1 %}
            Low power
          {% elif value_json.value == 2 %}
            VE.Bus Fault condition
          {% elif value_json.value == 3 %}
            Bulk charging
          {% elif value_json.value == 4 %}
            Absorption charging
          {% elif value_json.value == 5 %}
            Float charging
          {% elif value_json.value == 6 %}
            Storage mode
          {% elif value_json.value == 7 %}
            Equalize
          {% elif value_json.value == 8 %}
            Passthru
          {% elif value_json.value == 9 %}
            Inverting
          {% elif value_json.value == 10 %}
            Assisting
          {% elif value_json.value == 252 %}
            External control
          {% elif value_json.value == 256 %}
            Discharging
          {% elif value_json.value == 257 %}
            Sustain
          {% elif value_json.value == 258 %}
            Recharging
          {% elif value_json.value == 259 %}
            Scheduled recharging
          {% else %}
            Error - No Data
          {% endif %}
      
      # Current state of your charge controller
      - name: "Solar Charger State"
        unique_id: "solar_charger_state"
        state_topic: "venus-home/N/c0619xxxxxx/solarcharger/289/State"
        value_template: >
          {% if value_json.value == 0 %}
            Off
          {% elif value_json.value == 2 %}
            Fault
          {% elif value_json.value == 3 %}
            Bulk
          {% elif value_json.value == 4 %}
            Absorption
          {% elif value_json.value == 5 %}
            Float
          {% elif value_json.value == 6 %}
            Storage
          {% elif value_json.value == 7 %}
            Equalize
          {% else %}
            Error - No Data
          {% endif %}
    
    switch:
      #Multiplus Entladeleistung Begrenzen !Number
      - unique_id: multiplus_switch_discharge_power
        name: Inverter Power 
        command_topic: "venus-home/W/c0619xxxxxx/settings/0/Settings/CGwacs/MaxDischargePower"
        payload_on: '{"value": 1000}'
        payload_off: '{"value": -1}'
        state_topic: "venus-home/N/c0619xxxxxx/settings/0/Settings/CGwacs/MaxDischargePower"
        value_template: >
          {% if value_json.value | int == -1 %}
            {% set state_limit = 'OFF' %}
          {% else %}
            {% set state_limit = 'ON' %}
          {% endif %}
          {{ state_limit }}
        state_on: 'ON'
        state_off: 'OFF'
        
        device: {
          identifiers: [
            "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
      #Multiplus AC PV-Überschuss einspeisen
      - unique_id: multiplus_allow_ac_feed_in
        name: Multiplus allow AC feed in
        command_topic: "venus-home/W/c0619xxxxxx/settings/0/Settings/CGwacs/PreventFeedback"
        payload_on: '{"value": 0}'
        payload_off: '{"value": 1}'
        state_topic: "venus-home/N/c0619xxxxxx/settings/0/Settings/CGwacs/PreventFeedback"
        value_template: "{{ value_json.value | int }}"
        state_on: '0'
        state_off: '1'
        
        device: {
          identifiers: [
            "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
      #Multiplus DC PV-Überschuss einspeisen
      - unique_id: multiplus_allow_dc_feed_in
        name: Multiplus allow DC feed in
        command_topic: "venus-home/W/c0619xxxxxx/settings/0/Settings/CGwacs/OvervoltageFeedIn"
        payload_on: '{"value": 1}'
        payload_off: '{"value": 0}'
        state_topic: "venus-home/N/c0619xxxxxx/settings/0/Settings/CGwacs/OvervoltageFeedIn"
        value_template: "{{ value_json.value | int }}"
        state_on: '1'
        state_off: '0'
        
        device: {
          identifiers: [
            "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
  • Ping network devices

    - platform: ping
      host: 192.168.178.1
      name: ping Fritzbox
      count: 2
      scan_interval: 30
    
  • Create sensor for remaining battery time

    In this example the home battery system has a capacity of 300Ah (15kWh / 48V).
    As a safe minimal value is 15% capacity left is chosen. When grid is failing, there is still 2.5kWh left. When charging occurs, this will be shown instead of the remaining time.

    You can use the created sensor ‘sensor.template_time_left_on_battery_min_soc’ to display on your dashboard.

      - sensor:
          - unique_id: time_left_on_battery_min_soc
        #   unit_of_measurement: "Hours"
            icon: mdi:sort-clock-ascending
            state: >
              {% set battery_current = states('sensor.battery_current')|float %}
              {% set battery_soc = states('sensor.battery_percent')|float %}
              {% set loads_current = states('sensor.ac_loads')|float/states('sensor.battery_voltage')|float %}
              {% set battery_min_soc = 15 %}
              {% set battery_max_capacity = 300 %}
              {% if (battery_soc-battery_min_soc) < 0 %}
                {{ 0 }}
              {% elif (loads_current) < 0 %}
                {{ 'Charging' }}
              {% else %}
                {{ ((((battery_soc-battery_min_soc)*battery_max_capacity)/100)/loads_current | float ) | round(2) }}
              {% endif %}
    
    
  • Convert value ‘unavailable’ to 0

    template:
      # Solar production - Prevent showing unavailable instead of 0
      - sensor:
          - name: "Solar Current Power"
            unit_of_measurement: "W"
            state: "{{ 0 if states('sensor.on_grid_l1_power') == 'unavailable' else states('sensor.on_grid_l1_power' ) }}"
    
    
  • SSL in Home Assistant

    Place your fullchain.pem and privkey.pem in folder /ssl

    Apply SSL to your HA Instance by adding the following code to your configuration.yaml

    # SSL Certificate
    http:
      ssl_certificate: /ssl/fullchain.pem
      ssl_key: /ssl/privkey.pem
    
  • KPN / XS4ALL / pfSense IPTV

    (This article is in dutch language because it is only applicable on dutch TV providers)

    Hierbij mijn werkende configuratie voor IPTV met pfSense als router.
    Hierbij is op glasvezelaansluiting een NTU gemonteerd die het optische signaal omzet naar koper/UTP.

    Ik maak gebruik van een Qotom computer die voorzien is van 6 netwerk interfaces (Intell chipset). Daardoor heb ik interfaces Igb0 t/m Igb5 tot mijn beschikking. Daarbij heb ik gekozen om mijn interne IPTV via een apart VLAN te laten lopen. Dit is NIET noodzakelijk. Dit kan namelijk ook gewoon via LAN.
    Als je dat wil doen, zorg dan dat je de firewall rules uit IPTV_LAN overneemt (incl. ip options!) naar je LAN firewall rules.

    Hieronder een reeks screenshots zoals ik het geconfigureerd heb.
    Voor vragen kun je me altijd benaderen via comments onder aan deze pagina. (registreren noodzakelijk i.v.m. spam)

    Interface Assignments

    In mijn configuratie zijn onderstaande aansluitingen van belang:
    Igb0 = WAN (verbonden via UTP-kabel aan de NTU)
    Igb1 = LAN
    Igb3 = IPTV_LAN

    wan Interface details
    lan Interface details
    iptv_wan Interface details
    iptv_lan Interface details
    FiREWALL RULES LAN
    FIRewall rules iptv_Wan

    Let op! Bij de bovenste regel is via Advanced options ‘Allow IP options’ aangevinkt’

    FIRewall rules iptv_LAn

    Let op! Bij de bovenste 2 regels is via Advanced options ‘Allow IP options’ aangevinkt’

    IGMP PROXY
    NAT OUTBOUND

    Set Outbound Nat mode op ‘Hybrid mode’.
    Zorg dat je onderstaande mapping toevoegd. Er zullen ook automatische rules aangemaakt worden.

    EXTRA AANDACHT VOOR:

    • Als je de Settopbox rechtstreeks aansluit op een netwerkaansluiting van pfsense, raakt de pfsense interface disconnected tijdens her-/opstart van de settopbox. De IGMP-Proxy crasht daardoor. Het via een switch aansluiten van van de settop box loste dit probleem op.
  • Proxmox backup already exists

    When you run into this error:

    “TASK ERROR: zfs error: cannot create ‘rpool/vm-302-state-update’: dataset already exists”

    Try this solution:

    zfs destroy rpool/vm-302-state-update
    
  • Proxmox ZFS replace drive

    1: have a look what is there:

    ls -alh /dev/disk/by-id/
    zpool status
    zpool list -v

    2: set the hard drive you want to change offline:

    zpool offline "POOLNAME"  "HARD-DRIVE-ID or the whole path"
    ## example:
    zpool offline rpool wwn-0x50014ee25ba1a5e4

    3: change the hard drives physically
    shutdown and replace the disk (no hot-swap)

    4: create an empty GPT Partition Table on the new hdd with parted:

    parted /dev/new-disk
    (parted)# print
    (parted)# mklabel GPT
    (parted)# Yes
    (parted)# q

    5: replace them in the ZFS Pool:

    zpool replace "POOLNAME" "HARD-DRIVE-ID or the whole path old hard drive"  "HARD-DRIVE-ID or the whole path NEW hard drive"
    ## example:
    zpool replace rpool wwn-0x50014ee25ba1a5e4 wwn-0x5000cca27edf438f

    6: have a look what’s going on:

    zpool status
    ....
    resilver in progress since Sat Feb 29 11:43:52 2020
    328G scanned at 3,77G/s, 75,5G issued at 888M/s, 328G total
      8,83G resilvered, 23,01% done, 0 days 00:04:51 to go
    ....
  • Remove Proxmox 6.x/5.1+ Subscription Notice

    (source: https://johnscs.com/remove-proxmox51-subscription-notice/)

    With the release of Proxmox 5.1 and newer (including 6.2) you’ll find the code related to the no subscription message that pops up on login has changed and prior instructions for removing it wont work.

    To remove “You do not have a valid subscription for this server” run the command bellow. You will need to SSH to your Proxmox machine or use the node console through the PVE web interface.

    If you update your Proxmox server and the update includes a new version of the file we are about to edit then you’ll need to run the command again.

    Run the following one line command and then clear your browser cache (depending on the browser you may need to open a new tab or restart the browser):

    sed -i.bak "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js &amp;&amp; systemctl restart pveproxy.service

    Here are alternative step by step instructions so you can understand what the above command is doing:

    1. Change to working directory
      cd /usr/share/javascript/proxmox-widget-toolkit
    2. Make backup of file
      cp proxmoxlib.js proxmoxlib.js.bak
    3. Edit the file
      nano proxmoxlib.js
    4. Locate this line of code inside the file (use ctrl+w in nano)
      if (data.status !== 'Active') {
    5. Replace it with this
      if (false) {
    6. Restart the Proxmox service (also be sure to clear your browser cache, depending on the browser you may need to open a new tab or restart the browser)
      systemctl restart pveproxy.service