I am assuming this is not working for you, as it looks malformed. The entities do not appear correct for one. Also I suggest rounding the result, not the individuals to get your 2 digits of precision in the result you are looking for. Also in the final result, availability template is also suggested to prevent unexpected results.
Take the part you wrote there and paste it into the developer - templates tool and get it to do what you want it to do.
A sample on what it might look like in the end after you fix your entity_id’s…
template:
sensor:
- name: diningroom_lights
unique_id: Unique string here
state: >
{{ states('sensor.energy_consumed_daily')|float(0) +
states('sensor.gemeten_energie_per_dag')|float(0)
| round(2) }}
unit_of_measurement: W
device_class: energy
state_class: total
availability: >
{{has_value('sensor.energy_consumed_daily') and
has_value('sensor.gemeten_energie_per_dag')}}