Homematic send value from HA of another variable to ccu

Hello all,

Sorry for bothering. I am trying to get some automation working but for some reason I can’t seem to get there. Short story, I want to send a value from a variable to a device using a service every 5 minutes. So for this I first try manually to see it working and this is where it fails.
If I do this it works without issues but the value it’s the one I fill manually:

 
Service
homematic.set_variable_value
 
Entity
homematic.ccu2

Service Data (YAML, optional)

entity_id: homematic.ccu2
name: Temperature_Home
value: 1

If I try to send another value that I already have in a variable it fails with error could not convert string to float:

Service
homematic.set_variable_value
 
Entity
homematic.ccu2
Service Data (YAML, optional)

entity_id: homematic.ccu2
name: Temperature_Home
value: sensor.temp_home

From the logs I get this:

2021-02-12 13:00:44 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140004873578288] could not convert string to float: 'sensor.temp_home'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1484, in _execute_service
    await self._hass.async_add_executor_job(handler.job.target, service_call)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/homematic/__init__.py", line 314, in _service_handle_value
    hub.hm_set_variable(name, value)
  File "/config/custom_components/homematic/entity.py", line 280, in hm_set_variable
    value = float(value)
ValueError: could not convert string to float: 'sensor.temp_home'
2021-02-12 13:00:44 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140004873578288] Sending {'id': 29, 'type': 'result', 'success': False, 'error': {'code': 'unknown_error', 'message': "could not convert string to float: 'sensor.temp_home'"}}

The sensor.temp_home I get it like this:

      temp_home:
        value_template: "{{ state_attr('weather.home', 'temperature')}}"

I have tried to get it as a float but with no luck. Any help it’s much appreciated and thanks lots in advance

@danielperna84 is there any chance you could have an idea on this and give me a hint? It would be highly appreciated